struct Solution {}

fn main() {}

impl Solution {
    pub fn missing_number(nums: Vec<i32>) -> i32 {
        let mut nums_sort = nums.clone();
        nums_sort.sort();
        for idx in 0..nums_sort.len() {
            if nums_sort[idx] != idx as i32 {
                return idx as i32;
            }
        }
        nums_sort.len() as i32
    }
}